﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once

#include "GcmpModelInterface.h"
#include "IObject.h"

namespace gcmp
{
    class IDocument;

    /// \brief 文档初始化器
    class GCMP_MODEL_INTERFACE_EXPORT IDocumentInitializer : public IObject
    {
        DEFINE_CAST_DERIVED(gcmp::IDocumentInitializer, gcmp::IObject)
    public:
        /// \brief 初始化文档
        ///
        /// 此方法由框架调用，用户可重写此方法定制文档初始化逻辑
        /// \param pDocument 需要初始化的文档
        /// \return true：初始化成功，false：初始化失败
        virtual bool InitializeDocument(IDocument* pDocument) = 0;

        /// \brief 创建初始化3d视图的文档初始化器
        ///
        /// 调用此方法得到的文档初始化器中，创建了3d视图
        /// \return 文档初始化器
        static OwnerPtr<IDocumentInitializer> CreateView3DDocumentInitializer();
    };
}


